from calculator_pt import Calculator
import unittest

class TestAdd(unittest.TestCase):

    def setUp(self) -> None:
        print('测试开始')

    def test_add1(self):
        cal=Calculator(1,1)
        self.assertEqual(cal.add(),2)
        print('用例1已执行')

    def test_add2(self):
        cal=Calculator(1,-1)
        self.assertEqual(cal.add(),0)
        print('用例2已执行')


    def teatDown(self)->None:
        print('测试结束')



class TestSub(unittest.TestCase):

    def setUp(self)->None:
        print('测试开始...')

    def test_sub1(self):
        cal=Calculator(2,1)
        self.assertEqual(cal.sub(),1)
        print('用例1已执行')

    def tearDown(self) -> None:
        print('测试结束...')